from element_opt import *

account="15941622061"
pwd="yhn20010410"


# Login
def login(driver):
    global account,pwd
    show_popw_btn = driver.find_element_by_css_selector('.user-notice')
    click_and_retry(show_popw_btn)
    print("那个...需要登录才能继续，不过上天为鉴，我并不会拿你的隐私哦～～～")
    if account==None or pwd==None:
        account = input("账号：")
        pwd = input("密码：")
    in_acc = driver.find_element_by_id('accountName')
    in_pwd = driver.find_element_by_id('accountPWD')
    submit = driver.find_element_by_css_selector('.login-pop__form-item  .login-btn')
    in_acc.send_keys(account)
    in_pwd.send_keys(pwd)
    click_and_retry(submit)